//
//  BJDynamicSnapshotCell.m
//  jinwang
//
//  Created by jzb on 2018/3/16.
//  Copyright © 2018年 jzb. All rights reserved.
//

#import "BJDynamicSnapshotCell.h"

@implementation BJDynamicSnapshotCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(BJDynamicSnapshotModel *)model{
    _model = model;
    
    self.user_nickname.text = model.user_nickname;
    [self.user_portrait sd_setImageWithURL:[NSURL URLWithString:model.user_portrait] placeholderImage:[UIImage imageNamed:@"默认头像"]];
    self.post_title.text = model.post_title;
    self.timeAndDistance.text = [NSString stringWithFormat:@"%@    %@",model.time,model.distance];
    self.see_num.text = [NSString stringWithFormat:@"人气%@",model.see_num];
    self.praise_num.text = [NSString stringWithFormat:@"%@",model.praise_num];
    self.gift_num.text = [NSString stringWithFormat:@"%@",model.gift_num];
    self.comment_num.text = [NSString stringWithFormat:@"%@",model.comment_num];
    self.share_num.text = [NSString stringWithFormat:@"%@",model.share_num];
    NSArray* array = [model.post_content componentsSeparatedByString:@","];
    self.imgNumber.text = [NSString stringWithFormat:@"+%lu",array.count];
    [self.imgsFirstImg sd_setImageWithURL:[NSURL URLWithString:array[0]] placeholderImage:[UIImage imageNamed:@"默认头像"]];
    [self.imgsFirstImg setContentMode:UIViewContentModeScaleAspectFill];
    
    self.imgsFirstImg.clipsToBounds = YES;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
